var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.request({
      url: app.globalData.url + 'getTodaysPromoteGoods',
      data: {
        actType: 3
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      method: 'GET',
      success: function (res) {
        that.setData({
          goods: res.data.object
        })
      },
      fail: function (res) { },
      complete: function (res) { },
    })
  },
  goodsDetail:function(e){
    const goodsId = e.currentTarget.dataset.goodsid
    wx.navigateTo({
      url: '../commodityDetail/commodityDetail?goodsId=' + goodsId,
      success: function(res) {},
      fail: function(res) {},
      complete: function(res) {},
    })
  }
})